#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>//rand()
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

int n,x;

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen("in.in", "r", stdin);
    cin >> n;
    while(n--){
        cin >> x;
        if(x&1){
            cout << 7;
            rep(i,1,(x-3)/2) cout << 1;
            cout << "\n";
        } else {
            rep(i,1,x/2) cout << 1;
            cout << "\n";
        }
    }

    return 0;
}